package api_init

import (
	"go_server/game_server/api/service/build"
	"go_server/game_server/api/service/build_resource"
	"go_server/game_server/api/service/buildrobot_info"
	"go_server/game_server/api/service/daily_task"
	"go_server/game_server/api/service/dream_scene"
	"go_server/game_server/api/service/grow_task"
	"go_server/game_server/api/service/hero_info"
	"go_server/game_server/api/service/hero_summon"
	"go_server/game_server/api/service/login"
	"go_server/game_server/api/service/main_task"
	"go_server/game_server/api/service/market"
	"go_server/game_server/api/service/states"
	"go_server/game_server/api/service/system_unlock"
	"go_server/game_server/protocol/pb"
	"go_server/zinx/ziface"
)

func BindApiHandler(server ziface.IServer) {
	server.AddRouter(uint32(pb.ProtocolManager_LoginAuth), login.GetLoginApi())
	server.AddRouter(uint32(pb.ProtocolManager_ClientTest), login.GetClientTestApi())
	server.AddRouter(uint32(pb.ProtocolManager_SetBuildPos), build.GetSetBuildPosApi())
	server.AddRouter(uint32(pb.ProtocolManager_BuildPos), build.GetGetBuildPosApi())
	server.AddRouter(uint32(pb.ProtocolManager_BlockInfo), build.GetUnlockBlockApi())
	server.AddRouter(uint32(pb.ProtocolManager_BuildRepair), build.GetRepairBuildApi())
	server.AddRouter(uint32(pb.ProtocolManager_BuildStatusChange), build.GetBuildStatusChangeApi())
	server.AddRouter(uint32(pb.ProtocolManager_WallRepair), build.GetWallRepairApi())
	buildrobot_info.BindApiHandler_BuildRobot(server)
	hero_info.BindApiHandler_HeroInfo(server)
	server.AddRouter(uint32(pb.ProtocolManager_GetDreamSceneList), dream_scene.ServiceObj.GetDreamSceneList)
	server.AddRouter(uint32(pb.ProtocolManager_DreamSceneBattle), dream_scene.ServiceObj.DreamSceneBattle)
	server.AddRouter(uint32(pb.ProtocolManager_DreamSceneMopUp), dream_scene.ServiceObj.DreamSceneMopUp)
	server.AddRouter(uint32(pb.ProtocolManager_GetDreamSceneBoxStates), dream_scene.ServiceObj.GetDreamSceneBoxStates)
	server.AddRouter(uint32(pb.ProtocolManager_GetDreamSceneBoxPrize), dream_scene.ServiceObj.GetDreamSceneBoxPrize)
	server.AddRouter(uint32(pb.ProtocolManager_GetMainTaskChapterInfo), main_task.ServiceObj.GetMainTaskChapterInfo)
	server.AddRouter(uint32(pb.ProtocolManager_GetMainTaskPrize), main_task.ServiceObj.GetMainTaskPrize)
	server.AddRouter(uint32(pb.ProtocolManager_GetDailyTaskList), daily_task.ServiceObj.GetDailyTaskList)
	server.AddRouter(uint32(pb.ProtocolManager_GetDailyTaskPrize), daily_task.ServiceObj.GetDailyTaskPrize)
	server.AddRouter(uint32(pb.ProtocolManager_GetDailyTaskChestPrize), daily_task.ServiceObj.GetDailyTaskChestPrize)
	server.AddRouter(uint32(pb.ProtocolManager_GetGrowTaskList), grow_task.ServiceObj.GetGrowTaskList)
	server.AddRouter(uint32(pb.ProtocolManager_GetGrowTaskPrize), grow_task.ServiceObj.GetGrowTaskPrize)
	server.AddRouter(uint32(pb.ProtocolManager_SummonShow), hero_summon.ServiceObj.SummonShow)
	server.AddRouter(uint32(pb.ProtocolManager_SummonHero), hero_summon.ServiceObj.SummonHero)
	server.AddRouter(uint32(pb.ProtocolManager_GetStateList), states.ServiceObj.GetStateList)
	server.AddRouter(uint32(pb.ProtocolManager_Weed), states.ServiceObj.Weed)
	server.AddRouter(uint32(pb.ProtocolManager_SaveTimeLine), states.ServiceObj.SaveTimeLine)
	server.AddRouter(uint32(pb.ProtocolManager_CollectFood), states.ServiceObj.CollectFood)
	server.AddRouter(uint32(pb.ProtocolManager_SaveNewGuide), states.ServiceObj.SaveNewGuide)
	server.AddRouter(uint32(pb.ProtocolManager_BuildResourceCollect), build_resource.ServiceObj.BuildResourceCollect)
	//server.AddRouter(uint32(pb.ProtocolManager_BuildResourceStates), build_resource.ServiceObj.BuildResourceStates)
	server.AddRouter(uint32(pb.ProtocolManager_BuildRescue), states.ServiceObj.BuildRescue)
	server.AddRouter(uint32(pb.ProtocolManager_marketExchange), market.ServiceObj.MarketExchange)
	server.AddRouter(uint32(pb.ProtocolManager_marketShow), market.ServiceObj.MarketShow)

	system_unlock.Init()
}
